//
//  AdmissionsCardViewController.m
//  CoachsBook
//
//  Created by MaBookPro on 2022/8/18.
//

#import "AdmissionsCardViewController.h"
#import "AdmissionsCardHeadView.h"
#import "AdmissionBottomView.h"
#import "AdmissionsCardCell.h"

@interface AdmissionsCardViewController ()<UITableViewDelegate,UITableViewDataSource>
{
    UITableView *_Tabview;
    AdmissionsCardHeadView *_AdmissionsCardHeadView;
    AdmissionBottomView *_AdmissionBottomView;
    AdmissionsCardCell *Cell;
    
}
@end

@implementation AdmissionsCardViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBar.hidden = YES;
    NavigationHeadView *navgationheadv = [[NavigationHeadView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, SafeAreaTopHight)];
    navgationheadv.backgroundColor = [UIColor whiteColor];
    navgationheadv.titlelabel.text = @"招生名片";
    navgationheadv.titlelabel.textColor  = [UIColor blackColor];
    [navgationheadv.backbtn addTarget:self action:@selector(returnback) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:navgationheadv];

    _AdmissionsCardHeadView = [[AdmissionsCardHeadView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, 240)];
    
    _AdmissionBottomView = [[AdmissionBottomView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, 550)];
    
    _Tabview  = [[UITableView alloc]initWithFrame:CGRectMake(0, SafeAreaTopHight, APPwidth, APPheight)];
    _Tabview.delegate = self;
    _Tabview.dataSource = self;
    _Tabview.backgroundColor = [UIColor purpleColor];
    _Tabview.separatorStyle = UITableViewCellSeparatorStyleNone;
    _Tabview.tableHeaderView = _AdmissionsCardHeadView;
    _Tabview.tableFooterView = _AdmissionBottomView;
    [self.view addSubview:_Tabview];
}
#pragma mark - UITableView DataSource

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    return 130;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 2;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString * str = @"cell";
    
    Cell  = [tableView dequeueReusableCellWithIdentifier:str];
    if (Cell == nil) {
        
        Cell = [[AdmissionsCardCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier:str];
    }
    
//    Cell.nameLab.text = @"学员:小芒果";
    
    Cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    
    return Cell;
}







-(void)returnback{
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark -视图即将出现
-(void)viewWillAppear:(BOOL)animated{
        
    ((TabbarController *)self.tabBarController).tabBarView.hidden = YES;
    
}
@end
